
#*--encoding:UTF-8--*

'''
整理数据
'''
from common.helper import Helper
from db.mysql import MysqlClient
class Arrangement( object ):

    def __init__(self):
        self.mysql = MysqlClient()
        self.name = "悦宝保·学幼住院医疗保险"

        # 拉取数据

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):

            if item["plan"] == "planA":

                plan = "免赔额2万/住院医疗保险金50万"

            elif item["plan"] == "planB":

                plan =  "免赔额3万/住院医疗保险金50万"

            elif item["plan"] == "planC":

                plan = "免赔额4万/住院医疗保险金50万"

            else:

                plan = "免赔额1万/住院医疗保险金20万"

            data["name"] = self.name
            data["company"] = "太平洋保险"
            data["year"] = item["year"]
            data["socialSec"] = item["socialSec"]
            data["plan"] = plan
            data["expire"] = "1年"
            data["extBloodCancer"] = item["ext_item"][::5] + "w"
            data["price"] = item["price"]
            Helper.mergeTable(self.name, self.mysql, data)